import Vue from "vue";
import Vuex from "vuex";
import menus from "./modules/menus";
Vue.use(Vuex);
export default new Vuex.Store({
  state: {
    token: "",
  },
  mutations: {
    SET_TOKEN: (state, res) => {
      console.log(res);
      const { access_token, refresh_token } = res;
      state.token = access_token;
      localStorage.setItem("token", access_token);
      localStorage.setItem("refresh_token", refresh_token);
    },
  },
  actions: {},
  modules: {
    menus,
  },
});
